﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;
/// <summary>
/// Summary description for FunctionDAO
/// </summary>
public class FunctionDAO:DBAccess
{
    string SQL_GET_FUNCTION_DETAIL = "select f.FunctionName, f.FunctionUrl from [Function] as f join RoleDetails as r on f.FunctionID = r.FunctionID where r.RoleID = @roleID";
	public FunctionDAO()
	{
		//
		// TODO: Add constructor logic here
		//
	}
    /// <summary>
    /// Load Details Function for User 
    /// </summary>
    /// <returns>DataSet</returns>
    public DataSet GetDetailsFunction(int roleID)
    {
        DataSet ds = new DataSet();
        SqlDataAdapter adapter = new SqlDataAdapter(SQL_GET_FUNCTION_DETAIL, conn);
        adapter.SelectCommand.Parameters.AddWithValue("@roleID", roleID);
        adapter.Fill(ds);
        return ds;
    }
    
}